package com.dudy.common.base;

import java.io.Serializable;

/**
 * @program: common
 * @author dudy
 * @create: 2020-11-03 10:58
 * @description: 统一返回值
 **/
public class CommonResponse<T> implements Serializable {
	private String resMsg;
	private int resCode;
	private T data;

	private CommonResponse(){
		this(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMassage(), null);
	}
	public CommonResponse(int resCode, String resMsg, T data) {
		this.data = data;
		this.resCode = resCode;
		this.resMsg = resMsg;
	}

	public String getResMsg() {
		return resMsg;
	}

	public CommonResponse<T> setResMsg(String resMsg) {
		this.resMsg = resMsg;
		return this;
	}

	public int getResCode() {
		return resCode;
	}

	public CommonResponse<T> setResCode(int resCode) {
		this.resCode = resCode;
		return this;
	}

	public T getData() {
		return data;
	}

	public CommonResponse<T> setData(T data) {
		this.data = data;
		return this;
	}
}
